import request from '@/utils/request'
import { IApi } from './types'

const api: IApi = {
  login: '/login',
  users: '/users',
  rights: '/rights/tree'
}


export function login(data: any) {
  return request({
    url: api.login,
    method: 'post',
    data
  })
}

export function getUserInfo(id: string) {
  return request({
    url: `${api.users}/${id}`,
    method: 'get'
  })
}

export function getRights() {
  return request({
    url: api.rights,
    method: 'get'
  })
}